package com.project.bean;

import com.project.valid.AddValid;

import javax.validation.constraints.Email;
import javax.validation.constraints.Pattern;

/**
 * 客户实体类
 */
public class CustomerBean {
    private int id;//主键id
    @Pattern(regexp = "[a-zA-Z\\u4e00-\\u9fa5]{2,}",message = "客户名称必须是两位以上汉字或字母")
    private String name;//客户名称
    @Pattern(regexp = "[a-zA-Z\\u4e00-\\u9fa5]{2,}",message = "负责人名称必须是两位以上汉字或字母")
    private String headMan; //客户负责人
    @Pattern(regexp = "\\S{4,}",message = "经营范围必须如实填写")
    private String scope;//客户经营范围
    @Pattern(regexp = "1[0-9]{10}",message= "客户电话必须是1开头的11位数字")
    private String tel;//客户电话
    @Pattern(regexp = "[a-zA-Z\\u4e00-\\u9fa5]{2,}",message = "客户地址必须如实填写")
    private String address;//客户地址
    @Pattern(groups = AddValid.class,regexp = "\\d{4,}@[a-z]{1,}.com",message = "邮件格式必须按格式填写")
    private String email;//客户邮箱

    public CustomerBean() {
    }

    public CustomerBean(String name, String headMan, String scope, String tel, String address, String email) {
        this.name = name;
        this.headMan = headMan;
        this.scope = scope;
        this.tel = tel;
        this.address = address;
        this.email = email;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHeadMan() {
        return headMan;
    }

    public void setHeadMan(String headMan) {
        this.headMan = headMan;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        return "CustomerBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", headMan='" + headMan + '\'' +
                ", scope='" + scope + '\'' +
                ", tel='" + tel + '\'' +
                ", address='" + address + '\'' +
                ", email='" + email + '\'' +
                '}';
    }
}
